class animal:
    pass
class dog(animal):
    pass
class cat(animal):
    pass
class pig(animal):
    pass
class animalFactory:
    def get_animal(self,animal_type:str):
        if animal_type == 'd':
            return dog()
        elif animal_type == 'c':
            return cat()
        elif animal_type == 'p':
            return pig()
dongwu = animalFactory()
gou = dongwu.get_animal('d')
mao = dongwu.get_animal('c')
zhu = dongwu.get_animal('p')
print(gou)
print(mao)
print(zhu)